1. Field of the Invention
The present invention relates to an automatic input threshold selector for digitally controlling a signal with an unfixed amplitude level such as a mouse signal by a one-chip microcomputer.
2. Description of Related Art
A mouse, an input device of a personal computer and the like, includes a light emitting device, a photo-detector and a disk with slits, which is placed between them and rotates in response to the movement of the mouse. The photo-device receives the light emitted from the light emitting device through the disk, and outputs a sinusoidal signal as the disk rotates. The sinusoidal signal is supplied to the one-chip microcomputer or the like to undergo digital processing. The sinusoidal signal, however, has an unfixed amplitude level because of variations in characteristics of the light emitting device and photo-device or of the degradation due to long-term use thereof. Therefore, to achieve accurate digital signal processing of such a sinusoidal signal with an uncertain amplitude level as of the mouse signal, it is necessary to suitably set an input threshold in accordance with the amplitude level of the sinusoidal signal.
FIG. 19 is a schematic diagram showing an arrangement of a conventional automatic input threshold selector. In FIG. 19, the reference numeral 21 designates a peak-hold circuit for detecting a maximum value of an input signal IN and for holding it; 22 designates a bottom-hold circuit for detecting a minimum value of the input signal IN and for holding it; 23 designates a voltage comparator for comparing the input signal IN with a reference level VR given as a threshold voltage. The voltage comparator of the automatic input threshold selector receives at its non-inverting input terminal the input signal IN, and at its inverting input terminal the threshold voltage VR generated by dividing with resistors R1 and R2 the difference between the maximum voltage output from the peak-hold circuit 21 and the minimum voltage output from the bottom-hold circuit 22.
Next, the operation of the conventional automatic input threshold selector will be described.
The voltage comparator 23 compares the input signal IN with the reference level VR. If the input signal IN is lower than the reference level VR, it outputs an xe2x80x9cLxe2x80x9d level signal as its output signal OUT, and if the input signal IN is higher than the reference level VR, it outputs an xe2x80x9cHxe2x80x9d level signal as the output signal OUT.
With the foregoing structure, the conventional automatic input threshold selector generates the reference level VR by dividing the difference between the maximum voltage and minimum voltage of the input signal held by the peak-hold circuit 21 and bottom-hold circuit 22. This, however, presents a problem of requiring a rather bulk circuit arrangement and large power consumption, resulting in a cost increase and low performance, considering that the automatic input threshold selector is installed in a semiconductor integrated circuit fabricated by a CMOS process.
The present invention is implemented to solve the foregoing problem. It is therefore an object of the present invention to provide an automatic input threshold selector with a rather small size and low power consumption. This is achieved by selecting an input threshold from a few predetermined levels in response to a compared result of the input signal with predetermined reference levels.
According to one aspect of the present invention, there is provided an automatic input threshold selector comprising: level decision means for deciding, among a plurality of level layers determined by a predetermined number of decision levels, a level layer to which a level of an input signal belongs; and input threshold setting means for selecting, in response to the level layer decided by the level decision means, at least one of input threshold candidates from among a predetermined number of input threshold candidates.
Here, the level decision means may decide, among the plurality of level layers, a level layer to which one of a maximum value and a minimum value of the input signal belongs; and the input threshold setting means may select, in response to the level layer decided by the level decision means, at least one of n input threshold candidates, where n is a natural number.
The level decision means may comprise: a reference level selecting switch for selecting one of the predetermined number of decision levels as a reference level; a first voltage comparator for comparing the input signal with the reference level; a logic gate for carrying out on-off control of a clock signal in response to an output signal of the voltage comparator; a shift register for shifting, in response to an output signal of the logic gate, its output state every time the input signal crosses the reference level in one of rising and falling directions of the input signal; and a decoder for outputting signals for identifying the level layer of the input signal in response to output signals of the shift register, wherein the reference level selecting switch may select the reference level in accordance with the output signals of the decoder, the input threshold setting means may comprise: the decoder; and an input threshold selecting switch for selecting, in response to the outputs of the decoder, one of the n input threshold candidates as the input threshold, and the automatic input threshold selector may further comprise a second voltage comparator for comparing the input signal with the input threshold.
The level decision means may comprise: maximum value level decision means for deciding, among (j+1) level layers determined by j maximum value decision levels, a level layer to which a maximum value of the input signal belongs, where j is a natural number; and minimum value level decision means for deciding, among (m+1) level layers determined by m maximum value decision levels, a level layer to which a minimum value of the input signal belongs, where m is a natural number, wherein the input threshold setting means may set the input threshold by selecting one of the input threshold candidates in response to the level layer decided by the maximum value level decision means and to the level layer decided by the minimum value level decision means.
The input threshold setting means may comprise: a first input threshold selecting switch for selecting, in response to the level layer decided by the level decision means, one of the n input threshold candidates as a first input threshold; and a second input threshold selecting switch for selecting, in response to the level layer decided by the level decision means, another one of the n input threshold candidates as a second input threshold, and the automatic input threshold selector may further comprise Schmitt circuit means for comparing the input signal with the first input threshold when the input signal is rising, and with the second threshold when the input signal is falling.
The level decision means may comprise: maximum value level decision means for deciding, among (j+1) level layers determined by j maximum value decision levels, a level layer to which a maximum value of the input signal belongs, where j is a natural number; and minimum value level decision means for deciding, among (m+1) level layers determined by m maximum value decision levels, a level layer to which a minimum value of the input signal belongs, where m is a natural number, the input threshold setting means may comprise: first input threshold setting means for setting a first input threshold by selecting one of predetermined n1 first input threshold candidates in response to the level layer decided by the maximum value level decision means, where n1 is a natural number; and second input threshold setting means for setting a second input threshold by selecting one of predetermined n2 second input threshold candidates in response to the level layer decided by the minimum value level decision means, where n2 is a natural number, and the automatic input threshold selector may further comprise Schmitt circuit means for comparing the input signal with the first input threshold when the input signal is rising, and with the second threshold when the input signal is falling.
The level decision means may comprise: rising decision level identifying means for identifying, when the input signal is rising, a level the input signal exceeds among j rising decision levels, where j is a natural number; and falling decision level identifying means for identifying, when the input signal is falling, a level the input signal falls below among m falling decision levels, wherein the input threshold setting means may set, when the input signal is rising, the input threshold by selecting one of n input threshold candidates in response to the rising decision level decided by the rising decision level identifying means, where n is a natural number, and may set, when the input signal is falling, the input threshold by selecting one of the n input threshold candidates in response to the falling decision level decided by the falling decision level identifying means.
The automatic input threshold selector may further comprise input threshold initializing means for initializing by means of software the input threshold that has been set.
The automatic input threshold selector may further comprise a signal line, connected to a reset input terminal of the shift register, for supplying the shift register with a shift register initializing signal by means of software.
The level decision means may comprise level decision disabling means for halting operation of the level decision means by means of software.
The first voltage comparator may comprise an enable signal input terminal for supplying the first voltage comparator with an enable signal for locking an output of the first voltage comparator.
The input threshold setting means may comprise input threshold check means for checking, by means of software, the input threshold that has been set.
The input threshold setting means may comprise a register for storing the outputs of the decoder.
The input threshold setting means may comprise means for setting the input threshold at a desired value by means of software.
The input threshold setting means may comprise a register for storing a desired value determined by means of software, and a selector for selecting one of the output of the decoder and an output of the register for controlling the input threshold selecting switch.